import importlib
from typing import Type


def create_instance(full_class_name, **kwargs):
    # 分割模块名和类名
    module_name, class_name = full_class_name.rsplit('.', 1)
    # 动态导入模块
    module = importlib.import_module(module_name)
    # 获取类对象
    cls = getattr(module, class_name)
    # 创建类实例
    instance = cls(**kwargs)
    return instance


def get_full_class_name(cls: Type):
    return f"{cls.__module__}.{cls.__qualname__}"
